package com.bytech.common.utils;

import javax.annotation.Resource;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;
import redis.clients.jedis.JedisCluster;

/**
 * @Author zhao
 * @Create 2021/7/22 17:28
 */
@Component
@Slf4j
public class JedisClient {

    @Resource
    private JedisCluster jedisCluster;

    public <T> T go(RedisAction<T> action) {
        return action.action(jedisCluster);
    }

    public interface RedisAction<T> {
        T action(JedisCluster jedisCluster);
    }
}
